<?php

use Illuminate\Database\Seeder;

class AdminInitSeeder extends Seeder
{
    /**
     * Run the database seeds.
     *
     * @return void
     */
    public function run()
    {
        \App\Models\Admin\AdminUser::truncate();
        \App\Models\Admin\Permission::truncate();
        \DB::select(
            <<<SQL
                INSERT INTO `admin_permissions` (`id`, `name`, `label`, `description`, `cid`, `icon`, `created_at`, `updated_at`)
VALUES
('1', 'admin.permission', '权限管理', '', '0', 'fa-users', '2016-05-21 10:06:50', '2016-06-22 13:49:09'),
('2', 'admin.permission.index', '权限列表', '', '1', '', '2016-05-21 10:08:04', '2016-05-21 10:08:04'),
('3', 'admin.permission.create', '权限添加', '', '1', '', '2016-05-21 10:08:18', '2016-05-21 10:08:18'),
('4', 'admin.permission.edit', '权限修改', '', '1', '', '2016-05-21 10:08:35', '2016-05-21 10:08:35'),
('5', 'admin.permission.destroy ', '权限删除', '', '1', '', '2016-05-21 10:09:57', '2016-05-21 10:09:57'),
('6', 'admin.role.index', '角色列表', '', '1', '', '2016-05-23 10:36:40', '2016-05-23 10:36:40'),
('7', 'admin.role.create', '角色添加', '', '1', '', '2016-05-23 10:37:07', '2016-05-23 10:37:07'),
('8', 'admin.role.edit', '角色修改', '', '1', '', '2016-05-23 10:37:22', '2016-05-23 10:37:22'),
('9', 'admin.role.destroy', '角色删除', '', '1', '', '2016-05-23 10:37:48', '2016-05-23 10:37:48'),
('10', 'admin.user.index', '用户管理', '', '1', '', '2016-05-23 10:38:52', '2016-05-23 10:38:52'),
('11', 'admin.user.create', '用户添加', '', '1', '', '2016-05-23 10:39:21', '2016-06-22 13:49:29'),
('12', 'admin.user.edit', '用户编辑', '', '1', '', '2016-05-23 10:39:52', '2016-05-23 10:39:52'),
('13', 'admin.user.destroy', '用户删除', '', '1', '', '2016-05-23 10:40:36', '2016-05-23 10:40:36'),
('14', 'admin.tag', '标签', '', '0', 'fa-tags', '2017-04-28 15:19:52', '2017-04-28 15:19:52'),
('15', 'admin.tag.index', '标签', '', '14', '', '2017-04-28 15:20:57', '2017-04-28 15:20:57'),
('16', 'admin.tag.create', '添加标签', '', '14', '', '2017-04-28 15:21:24', '2017-04-28 15:21:24'),
('17', 'admin.tag.edit', '编辑标签', '', '14', '', '2017-04-28 15:21:50', '2017-04-28 15:21:50'),
('18', 'admin.tag.destory', '删除标签', '', '14', '', '2017-04-28 15:22:13', '2017-04-28 15:22:13'),
('19', 'admin.article', '文章管理', '', '0', 'fa-tasks', '2017-04-28 15:23:13', '2017-04-28 15:23:13'),
('20', 'admin.category.index', '分类管理', '', '19', '', '2017-04-28 15:23:45', '2017-04-28 15:23:45'),
('21', 'admin.category.create', '添加分类', '', '19', '', '2017-04-28 15:24:51', '2017-04-28 15:24:51'),
('22', 'admin.category.edit', '修改分类', '', '19', '', '2017-04-28 15:25:05', '2017-04-28 15:25:05'),
('23', 'admin.category.destory', '分类删除', '', '19', '', '2017-04-28 15:25:25', '2017-04-28 15:25:25'),
('24', 'admin.atlc.index', '发布文章', '', '19', '', '2017-04-28 15:25:55', '2017-04-28 15:25:55'),
('25', 'admin.article.edit', '编辑文章', '', '19', '', '2017-04-28 15:31:37', '2017-04-28 15:34:19'),
('26', 'admin.article.destory', '文章删除', '', '19', '', '2017-04-28 15:32:18', '2017-04-28 15:32:18'),
('27', 'admin.article.index', '文章管理', '', '19', '', '2017-04-28 15:32:55', '2017-04-28 15:32:55'),
('28', 'admin.navigation', '导航', '', '0', 'fa-exchange', '2017-05-08 10:41:03', '2017-05-08 10:41:03'),
('29', 'admin.navigation.edit', '修改导航', '', '28', '', '2017-05-24 16:44:57', '2017-05-24 16:44:57'),
('30', 'admin.navigation.destory', '导航删除', '', '28', '', '2017-05-24 16:45:52', '2017-05-24 16:45:52'),
('31', 'admin.navigation.create', '添加导航', '', '28', '', '2017-05-24 16:44:35', '2017-05-24 16:44:35'),
('32', 'admin.navigation.index', '导航管理', '', '28', '', '2017-05-08 10:41:26', '2017-05-08 10:41:26');
;
SQL
        );
        $admin = new \App\Models\Admin\AdminUser();
        $admin->
        id = 1;
        $admin->image = '2017-05-03-4416.jpg';
        $admin->name = 'vanity';
        $admin->email = 'vanity@admin.com';
        $admin->password = bcrypt('vanity');
        $admin->save();

        $article_category = new \App\Models\Admin\Category();
        $article_category->id = 1;
        $article_category->pid = 0;
        $article_category->path = '0,';
        $article_category->name = '顶级分类';
        $article_category->save();
    }
}
